#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>

void Find_lilyNum()
{
	int i = 0;
	for (i = 10000; i < 100000; i++)
	{
		int n = i;
		int j = 0;
		int back_parts = 0;
		int front_parts = 0;
		int sum = 0;
		for (j = 0; j < 4; j++)
		{
			int tep = pow(10, j + 1);
			back_parts = n % tep;
			front_parts = n / tep;
			sum += front_parts * back_parts;
		}
		if (sum == i)
		{
			printf("%d ", i);
		}
	}
}

int main()
{
	Find_lilyNum();
	return 0;
}